public class Relatedcontact
{
 public ApexPages.StandardController stdCtr {get; set;}
  
 public List<Contact> contacts {get; set;}
  
 public Relatedcontact(ApexPages.StandardController std)
 {
  stdCtr=std;
  setupContacts();
  close();
 }
 
 private void setupContacts()
 {
  contacts=[select id, Name, Email, Phone from Contact where AccountId=:stdCtr.getId()];
  }
  public PageReference close() {  
  System.debug('I am in Page referance');
     return new PageReference('javascript:window.close()'); 
     }
  }